@echo off
set log=TEST_RESULT.log
if exist %log% (
    del %log%
)

for %%i in (*.etl) do (
    call run %%~ni
    fc /n %%~ni.etl %%~ni.out > NUL
    if ERRORLEVEL 1 (
        echo %%~ni -- FAIL
        fc %%~ni.etl %%~ni.out >> %log%
    ) else (
        echo %%~ni -- OK
    )
    del %%~ni.asm %%~ni.obj %%~ni.out
)

echo.
if exist %log% (
    echo One or more tests failed.
    echo See detailed information in the %log% file.
) else (
    echo All tests successful.
)